import math

def Ramanujan_pi(n):
    sum_value = 0
    for k in range(n):
        numerator = math.factorial(4 * k) * (1103 + 26390 * k)
        denominator = (math.factorial(k) ** 4) * (396 ** (4 * k))
        sum_value += numerator / denominator
    
    constant_factor = (2 * math.sqrt(2)) / 9801
    pi_approx = 1 / (constant_factor * sum_value)
    return pi_approx

if __name__ == '__main__':
    times = int(input()) 
    pi_estimate = Ramanujan_pi(times)
    print(f'{pi_estimate:.15f}')


